package com.example.aopdemo.controller;

import com.example.aopdemo.aspect.TimeRecord;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: hp
 * Date: 2025-01-26
 * Time: 18:45
 */
@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {
    @TimeRecord
    @RequestMapping("/u1")
    public String t1() {
        log.info("执行u1方法");
        return "u1";
    }

    @TimeRecord
    @RequestMapping("/u2")
    public String t2() {
        log.info("执行u2方法");
        return "u2";
    }
}
